<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
/*******basic*******/
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('storeset',$postdata);
		exi('设置成功');
	}
	$return['item']=$this->plugin_setting('storeset');
	$htmls=array(
		'type'=>'edit',
		'desc'=>'门店设置',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'门店设置',
				'list'=>array(
					array('type'=>'switch','title'=>'开启门店机制','name'=>'isopen','help'=>'<red>对应生鲜配送的/同城配送的，建议开启，平台商城的可以不用开启；开启门店机制后，从客户进入商城开始，就为客户就近指定一个门店！所有的商品价格，规格，库存等都按该门店的来！</red>'),
					array('type'=>'switch','title'=>'开启商品统一','name'=>'no_goods','help'=>'开启门店商品统一后，所有的商品价格，规格，库存等都统一按平台的走，跟个门店没关系！就算开启上面的门店机制，门店独立设置的价格，规格，库存等也都失效！'),
					array('type'=>'select','title'=>'门店餐桌二维码action','name'=>'tableaction','options'=>'tableactions','help'=>'选择餐桌二维码指向的action'),
				)
			),
			array(
				'title'=>'语音设置',
				'list'=>array(
					array('type'=>'tip','title'=>'叫号语音模式：叫号文字前缀+号码+叫号文字后缀'),
					array('type'=>'string','title'=>'叫号文字前缀','name'=>'queue_text0','help'=>'例如：客官'),
					array('type'=>'string','title'=>'叫号文字后缀','name'=>'queue_text1','help'=>'例如：轮到你吃鱼啦！'),
					array('type'=>'radio','title'=>'叫号语音种类','name'=>'queue_audiotype','options'=>'audiotypes','help'=>'如果种类为空，请移步《<a href="javascript:;" ng-click="access_json(\'jy_qqailab/index/\')">腾讯语音合成</a>》云接口插件，设置添加种类！'),
				)
			),
		),
	);
	if($this->plugin_exists('jy_qqailab')){
		$jy_qqailabset=plugin('jy_qqailab')->plugin_setting('basic');
	}
	$return['audiotypes']=array();
	foreach($jy_qqailabset['list'] as $item){
		$return['audiotypes'][]=$item['title'];
	}
	$return['tableactions']=array(
		array('id'=>'jy_weishop/store.goodslist/','title'=>'默认设置')
	);
	$install = check_permission('jy_dish');
	if($install){
		$return['tableactions'][]=array('id'=>'jy_weidish/goodslist/','title'=>'小周餐厅');
	}
	$install = check_permission('jy_weidish_xibei');
	if($install){
		$return['tableactions'][]=array('id'=>'jy_weidish_xibei/goodslist/','title'=>'西贝在线点餐');
	}
	$return['htmls']=$htmls;
	exi($return);
}
/*******basic*******/
/*******op*******/
